Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #484, #447 #503

Closed
wants to merge 1 commit into from
Closed

Conversation

sphaerophoria
Copy link

In TargetManager, getTargets, and by extension fillTargets, has an
implicit requirement that pathTarget.targets is not empty. If it is we
re-call refreshTargets which would end up with infinite recursion. We
have enough information to retrace the steps fillTargets currently takes so
we can just set them ourselves.

There are three failing tests with my current implementation, however these three tests were failing before I made any changes.

In TargetManager, getTargets, and by extension fillTargets, has an
implicit requirement that pathTarget.targets is not empty. If it is we
re-call refreshTargets which would end up with infinite recursion. We
have enough information to retrace the steps fillTargets currently takes so
we can just set them ourselves
@noseglid
Copy link
Owner

noseglid commented Apr 22, 2017

I'm sorry for being so slow to reply to this.

What would really help is if we could add a spec, so we can guarantee it doesn't reappear.

Regarding the code itself. I think it would make more sense to pass a bool to fillTargets called refreshOnEmpty that defaults to true. This should be continually passed to getTargets which should refrain from refreshing if it is false. From the refreshTargets function this should be false.

Doing it like this and we'd avoid duplicating the fillTargets code, keeping it DRY.

noseglid added a commit that referenced this pull request May 22, 2017
Thanks to @sphaerophoria for correctly identifying the issue
and providing an initial solution in #503.

Fixes: #484, #447
noseglid added a commit that referenced this pull request May 22, 2017
Thanks to @sphaerophoria for correctly identifying the issue
and providing an initial solution in #503.

Fixes: #484, #447
@noseglid noseglid mentioned this pull request May 22, 2017
@noseglid
Copy link
Owner

Commited this in #520

@noseglid noseglid closed this May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants